package com.airS.task.fileMgr.controller.sys;

import com.airS.task.fileMgr.common.page.Page;
import com.airS.task.fileMgr.controller.base.SupportController;
import com.airS.task.fileMgr.model.sys.SysOperalog;
import com.airS.task.fileMgr.query.sys.SysOperalogQuery;
import com.airS.task.fileMgr.service.sys.SysOperalogService;
import com.airS.task.fileMgr.utils.url.UrlUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * 系统日志管理
 * Created by alan on 2017/3/17.
 */
@Controller
@RequestMapping("/sys")
public class SysOperalogController extends SupportController {

    private static Logger logger = LoggerFactory.getLogger(SysOperalogController.class);

    @Autowired
    private SysOperalogService sysOperalogService;

    /**
     * 系统日志列表
     * @param sysOperalogQuery
     * @param request
     * @param modelMap
     * @return
     */
    @RequestMapping("/sysOperalogShow")
    public String fileOperalogShow(SysOperalogQuery sysOperalogQuery, HttpServletRequest request, ModelMap modelMap){
        sysOperalogQuery.setRequestUrl(UrlUtils.getLookupPathForRequest(request));
        Page<SysOperalog> sysOperalogPage = sysOperalogService.queryYunfiles(sysOperalogQuery);
        modelMap.put("sysOperalogPage", sysOperalogPage);
        return "admin/modules/sys/sys_oplog_list";
    }

}
